package com.example.demo.eight;

import com.example.demo.util.RabbitMQUtils;
import com.rabbitmq.client.*;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

/**
 * @author chensixiang chensixiang1234@gmail.com
 */
public class Producer02 {
    public static final String NORMAL_EXCHANGE = "normal_exchange";
    public static final String NORMAL_QUEUE = "normal_queue";

    public static void main(String[] args) throws Exception {
        Channel channel = RabbitMQUtils.getChannel();
        // ms
        AMQP.BasicProperties properties =
                new AMQP.BasicProperties()
                        .builder().expiration("10000").build();

        for (int i = 1; i <= 10; i++) {
            channel.basicPublish(NORMAL_EXCHANGE, "zhangsan", null, ("info" + i).getBytes());
        }

    }
}
